<page-bar></page-bar>
<nz-tabset nzType="card" [(nzSelectedIndex)]="params.index" (nzSelectedIndexChange)="changeType()" class="mt-md">
  <nz-tab *ngFor="let t of types" [nzTitle]="t"></nz-tab>
</nz-tabset>
<div class="mb-md">
  <button nz-popconfirm (nzOnConfirm)="remove()" nzTitle="删除消息?" nz-button [disabled]="checkList.length === 0">
    删除
  </button>
  <ng-container *ngIf="params.isRead !== 'read'">
    <button (click)="setRead()" nz-button [disabled]="checkList.length === 0">标记已读</button>
    <button (click)="setAllRead()" nz-button>全部已读</button>
  </ng-container>
</div>
<st #st [data]="url" [pi]="pi" [columns]="columns" [req]="{params: params, reName: { pi: 'current', ps: 'size' }}"
  [res]="{reName: { total: 'data.total', list: 'data.records'}}" (change)="change($event)" class="mb-md">
  <ng-template st-row="title" let-i>
    <nz-badge *ngIf="i.isRead === '0'" nzStatus="processing"></nz-badge>
    <a routerLink="/notification/inner/{{ params.isRead }}/detail/{{ i.id }}"
      [state]="{ pi: st.pi, isRead: params.isRead, index: params.index }"
      [ngClass]="{ 'text-grey': i.isRead === '1' }">{{ i.title }}</a>
  </ng-template>
</st>
